"! Info:
A string of text.
Examples:

"
Array subclass: String [
<category: 'Library-Text'>
"! Info:

Examples:
"
asNumber [
| val |
val := 0.
self do: [ :c |
	c isDigit ifFalse: [
        ^ nil
    ].
	val := (val * 10) + (c value - 48)
].
^ val
]

"! Info:

Examples:
"
at: index [
^ self at: index ifAbsent: [ 
    self badIndex 
]
]

"! Info:

Examples:
"
at: index ifAbsent: aBlock [
| c |
c := self basicAt: index.
(c isNil) ifTrue: [ 
	^ aBlock value 
] ifFalse: [ 
	^ Char new: c 
]
]

"! Info:

Examples:
"
at: index put: aValue [
(self basicAt: index put: aValue value) isNil ifTrue: [
	self badIndex
]
]

"! Info:

Examples:
"
basicAt: index [
<stringAt self index>
^ nil
]

"! Info:

Examples:
"
basicAt: index put: value [
<stringAtPut value self index>
^ nil
]

"! Info:

Examples:
"
collect: transformationBlock [
^ (super collect: transformationBlock) asString
]

"! Info:

Examples:
"
indexOf: val [
| c s |
c := val at: 1.
s := val size.
1 to: (self size - s + 1) do: [ :i |
	((self at: i) = c) ifTrue: [
		((self from: i to: (i + s - 1)) = val)
			ifTrue: [ ^ i ]
	]
].
^ nil
]

"! Info:

Examples:
"
printString [
^ self
]

"! Info:

Examples:
"
printWidth: width [
| ret |
(self size >= width absolute) ifTrue: [ 
    ^ self 
].
ret := self.
(width negative) ifTrue: [
	(self size + 1) to: (width negated) do: [ :i | 
        ret := ' ' + ret
    ].
] ifFalse: [
	(self size + 1) to: width do: [ :i | 
        ret := ret + ' ' 
    ].
].
^ ret
]

]

"! Class methods for String "
MetaArray subclass: MetaString [
<category: 'Library-Text'>
"! Info:
Create a new string of length size

Examples:
"
new: sz [
<bytearrayAlloc self sz>
]

"! Info:
Return a string of the newline character

Examples:
"
newline [
^ Char newline asString
]

]

